var lim=new limit();
lim.txtNote=document.getElementById("Remark_information");
lim.txtLimit=document.getElementById("txtCount");
lim.limitCount=80;
lim.init();
function limit(){
    var txtNote;//文本框
    var txtLimit;//提示字数的input
    var limitCount;//限制的字数
    var txtlength;//到达限制时，字符串的长度
    this.init=function(){
        txtNote=this.txtNote;
        txtLimit=this.txtLimit;
        limitCount=this.limitCount;
        txtNote.oninput=function(){wordsLimit()};txtNote.oninput=function(){wordsLimit()};
        txtLimit.innerText=limitCount;
    };
    function wordsLimit(){
        var noteCount=txtNote.value.length;
        var InPut=document.getElementById("Remark_information").value.length;
        if(InPut<1){
            document.getElementById("stay").style.display="none";
            return
        }
        if(InPut>=1){
            document.getElementById("stay").style.display="inline";
            document.getElementById("stay").style.color="green";
        }
        if(InPut>70){
            document.getElementById("stay").style.color="red";
        }
        if(noteCount>limitCount){
            txtNote.value=txtNote.value.substring(0,limitCount);
            txtLimit.innerText=0;
        }else{
            txtLimit.innerText=limitCount-noteCount;
        }
        txtlength=txtNote.value.length;//记录每次输入后的长度
    }
}